(function(){
	'use strict';

	var template = angular.module('zhxCalExtendTpl', []);

	template.run(function($templateCache){

		/**
		 * 日历格子内模板定义
		 * 
		 * 注：这里因为是定制模板，因此为了渲染效率，在展示内容上使用ng-style来控制显示或隐藏，而非ng-if
		 *
		 * @type {String}
		 */
		$templateCache.put('zhxCalExtendTpl.day.vicco',
			'<div class="user-extend-props" ' +
			'ng-dblclick="__showDayDetail($event)" ' +
			'ng-right-click="__showContextMenu($event)">' +
				'<div class="calDay-box top-box {{ ::pinProp.color }}" ng-style="{ display : day.userExtendProp[ pinProp.name ] ? \'flex\' : \'none\' }" >' +
					'<div class="calDay-name">{{ ::pinProp.displayName }}</div>' +
					'<div class="calDay-content">{{ ::day.userExtendProp[ pinProp.name ] }}</div>' +
				'</div>' +
				'<div class="mid-box">' +
					'<div ng-repeat="prop in ::listProp track by $index" class="calLDay-box {{ ::prop.color }}" ' +
					'ng-click="__showDayTip($event,prop)" ' +
					'ng-style="{ display : day.userExtendProp[ prop.name ].length ? \'flex\' : \'none\' }">' +
						'<div class="calDay-name">{{ ::prop.displayName }}</div>' +
						'<div class="calDay-content">{{ ::day.userExtendProp[ prop.name ].length }}</div>' +
					'</div>' +
				'</div> ' +
			'</div>');

		//日历格子左键点击弹出层模板
		$templateCache.put('zhxCalExtendTpl.day.layer.vicco',
			'<div class="cal-tip-all">' +
				'<div class="calDay-box top-box {{ ::pinProp.color }}" ng-if="day.userExtendProp[ pinProp.name ]">' +
					'<div class="calDay-name">{{ ::pinProp.displayName }}</div>' +
					'<div class="calDay-content">{{ ::day.userExtendProp[ pinProp.name ] }}</div>' +
				'</div>' +
				'<div class="cal-tip-list">' +
					'<ul>' +
						'<li><span>日期</span>{{ ::day.userExtendProp.date }}</li>' +
						'<li><span>计划趟次</span>{{ ::day.userExtendProp.plan_tangci }}</li>' +
						'<li><span>实际趟次</span>{{ ::day.userExtendProp.tangci }}</li>' +
						'<li><span>计划里程</span>{{ ::day.userExtendProp.plan_tangci }}公里</li>' +
						'<li><span>实际里程</span>{{ ::day.userExtendProp.totalMiles }}公里</li>' +
					'</ul>' +
				'</div>' +
			 '</div>');

		//日历格子右键菜单模板
		$templateCache.put('zhxCalExtendTpl.day.contextLayer.vicco',
			'<div class="cal-tip-ctxMenu">' +
				'<ul>' +
					'<li ng-click="addNew($event)">新增一条记录</li>' +
					'<li>修改一条记录</li>' +
					'<li>移除一条记录</li>' +
				'</ul>' +
			'</div>'
			);

	});

})()